From: Keir Fraser Date: Fri, 10 Jun 2011 07:08:44 +0000 (+0100) Subject: x86: Fix argument checking in (privileged) function cpu_add(). X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10218 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=3d948756835a327bce13b69c436ceeec75524a89;p=xen.git x86: Fix argument checking in (privileged) function cpu_add(). Thanks to John McDermott for spotting. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 44ee79c648..91eea68e36 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -887,7 +887,9 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm) dprintk(XENLOG_DEBUG, "cpu_add apic_id %x acpi_id %x pxm %x\n", apic_id, acpi_id, pxm); - if ( acpi_id > MAX_MADT_ENTRIES || apic_id > MAX_APICS || pxm > 256 ) + if ( (acpi_id >= MAX_MADT_ENTRIES) || + (apic_id >= MAX_APICS) || + (pxm >= 256) ) return -EINVAL; if ( !cpu_hotplug_begin() )